/////////////////
////////////////

#pragma once

#include "Enums.h"
#include "Defines.h"
#include "SDL.h"
#include "SDL_image.h"



class cPlayer
{
private:
	float m_X;
	float m_Y;
	SDL_Surface* m_Surf_Display;

	int m_SpeedX;

	int m_Width;
	int m_Height;
public:

	cPlayer();
	cPlayer(int x, int y, SDL_Surface* Surf_Display, int w, int h):m_X(x),m_Y(y),m_Surf_Display(Surf_Display),
		m_Width(w), m_Height(h)
	{
	}

	void OnLoad(char* File)
	{
		SDL_Surface* Surf_Temp = IMG_Load(File);
		m_Surf_Display = SDL_DisplayFormatAlpha(Surf_Temp);
		SDL_FreeSurface(Surf_Temp) ;
	}

	void Draw(SDL_Surface* Surf_Window, int X, int Y)
	{
		X = m_X;
		Y = m_Y;
		SDL_Rect source = {0, 0, PLAYER_WIDTH,PLAYER_HEIGHT};

		SDL_Rect destination = {X, Y, 
			PLAYER_WIDTH, PLAYER_HEIGHT};

		SDL_BlitSurface(m_Surf_Display, &source, Surf_Window, &destination);
	}





	int GetPlayer_X(){return m_X;}
	int GetPlayer_Y(){return m_Y;}

	void SetPlayer_x(int x)
	{
		m_X = x;
	}
	void SetPlayer_y(int y){m_Y = y;}

	int GetPlayer_SpeedX(){return m_SpeedX;}
	void SetPlayer_SpeedX(float x){m_SpeedX = x;}

	int GetWidth(){return m_Width;}
	int GetHeight(){return m_Height;}

	void SetWidth(int x){m_Width = x;}
	void SetHeight(int y){m_Height = y;}

};

cPlayer::cPlayer()
{
	m_X = 0;
	m_Y = 0;
	m_SpeedX = 0;
}